#tmux adds a very small delay when sending commands, and this delay can interfere with other programs such as the Vim text editor.
set -s escape-time 1

# Setting the prefix from C-b to C-a
set -g prefix C-a
# Free the original Ctrl-b prefix keybinding
unbind C-b

# Ensure that we can send Ctrl-A to other apps
bind-key C-a send-prefix

# Set the base index for windows to 1 instead of 0
set -g base-index 1
# Set the base index for panes to 1 instead of 0
setw -g pane-base-index 1

# Quick window selection
bind -r C-h select-window -t :-
bind -r C-l select-window -t :+

# Reload the file with Prefix r
bind-key r source-file ~/.tmux.conf \; display "Reloaded!"

# moving between panes with Prefix h,j,k,l
bind-key h select-pane -L
bind-key j select-pane -D
bind-key k select-pane -U
bind-key l select-pane -R

bind-key H resize-pane -L 5
bind-key J resize-pane -D 5
bind-key K resize-pane -U 5
bind-key L resize-pane -R 5

set -g default-terminal "screen-256color"

setw -g mode-keys vi

bind-key Escape copy-mode
bind-key -T copy-mode-vi v send-keys -X begin-selection
bind-key -T copy-mode-vi y send-keys -X copy-selection
unbind-key p
bind-key p paste-buffer

bind '"' split-window -c "#{pane_current_path}"
bind % split-window -h -c "#{pane_current_path}"
bind c new-window -c "#{pane_current_path}"

